package com.game.utils;

import com.game.model.api.*;
import com.game.model.equip.Equip;


/**
 * @Description:
 **/
public class Format {
//    public static String colorFormat(String content,int colorNumber){
//        return String.format("\033[%dm%s\033[0m", colorNumber, content);
//    }
    public static String colorFormat(String content, Color color){
        int colorNumber = 37;
        switch (color){
            case WHITE:colorNumber=37;break;
            case GREEN:colorNumber=32;break;
            case PURPLE:colorNumber=35;break;
            case BLUE:colorNumber=34;break;
            case ORGANGE:colorNumber=33;break;
            case YELLOW:colorNumber=33;break;
            case RED:colorNumber=31;break;
        }
        return String.format("\033[%dm%s\033[0m", colorNumber, content);
    }
    public static String underLineFormat(String content,int colourNumber){
        return String.format("\033[%d;4m%s\033[0m", colourNumber, content);
    }
    public static String getGoodsType(GoodsType goodsType){
        switch (goodsType){
            case Base:return "基础物品";
            case Exp:return "经验";
            case EQUIP:return "装备";
        }
        return "未知";
    }
    public static GoodsType getGoodsType(int i){
        switch (i){
            case 1:return GoodsType.Base;
            case 2:return GoodsType.Exp;
            case 3:return GoodsType.EQUIP;
            default:return null;
        }
    }
    public static String getQuality(Quality quality){
        switch (quality){
            case RED:return colorFormat("极品",Color.RED);
            case ORGANGE:return colorFormat("传说",Color.ORGANGE);
            case PURPLE:return colorFormat("史诗",Color.PURPLE);
            case BLUE:return colorFormat("精品",Color.BLUE);
            case GREEN:return colorFormat("稀有",Color.GREEN);
            case WHITE:return colorFormat("普通",Color.WHITE);
        }
        return "未知";
    }
    public static Quality getQuality(int i){
        switch (i){
            case 1:return Quality.WHITE;
            case 2:return Quality.GREEN;
            case 3:return Quality.BLUE;
            case 4:return Quality.PURPLE;
            case 5:return Quality.ORGANGE;
            case 6:return Quality.RED;
            default:return null;
        }
    }

    public static String getEquipType(EquipType equipType) {
        switch (equipType) {
            case WEAPON:
                return "武器";
            case LEG:
                return "腿部";
            case BODY:
                return "身体";
            case HEAD:
                return "头部";
            case SHOES:
                return "鞋子";
        }
        return "未知";
    }
    public static EquipType getEquipType(int i) {
        switch (i){
            case 1:return EquipType.WEAPON;
            case 2:return EquipType.HEAD;
            case 3:return EquipType.BODY;
            case 4:return EquipType.LEG;
            case 5:return EquipType.SHOES;
            default:return null;
        }
    }
    public static MonsterType getMonsterType(int i){
        switch (i){
            case 1:return MonsterType.WILD;
            case 2:return MonsterType.BOSS;
            default:return null;
        }
    }
    public static int  getRandomNumber(){
        return (int)(System.currentTimeMillis()/1000);
    }
}
